import axios from './axios';

export const getAllClasses = async () => {
  try {
    const response = await axios.get('/api/classes');
    return response.data;
  } catch (error) {
    console.error('Error fetching classes:', error);
    throw error;
  }
};

export const getClassById = async (id) => {
  try {
    const response = await axios.get(`/api/classes/${id}`);
    return response.data;
  } catch (error) {
    console.error(`Error fetching class with id ${id}:`, error);
    throw error;
  }
};
